package com.base.common.edu.mapper;

import com.base.common.edu.entity.Department;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author Maple.Chen
 * @Description 数据交互层-Department
 * @Date 14:52 2021/1/30
 **/
@Mapper
@Repository //@Component
public interface DepartmentMapper {

    // 添加部门
    int saveDept(@Param("dept") Department department);

    // 遍历所有部门
    List<Department> queryListOfDeptName();

    // 修改部门信息
    int updateDeptInfo(@Param("dept") Department department);

    // 删除部门信息
    int deleteDept(@Param("deptId") String departmentId);

    // 判断部门是否存在
    int existDeptJudge(@Param("deptName") String departmentName);

    // 根据id查询部门信息
    Department queryDepartmentById(String department_id);

    // 根据部门名称查询部门id
    String queryDeptIdByName(String dept__name);

    // 部门模糊搜索
    List<Department> queryListOfDeptByFuzzyName(@Param("dept__name") String dept__name);

    // 根据id查询部门/系信息
    List<Department> queryListOfDeptById(@Param("dept__id") String dept__id);

}
